# GNU Makefile
##################################################

CC = @CC@
CXX = @CXX@

SOURCES = neuron.cpp neuronlayer.cpp activation_function.cpp odd_sigmoid.cpp identity_activation.cpp \
	multidimensional_gaussian.cpp neuralnetwork.cpp backpropagation.cpp stretched_function.cpp \
	optimized_nnetwork_function.cpp \
	PSO.cpp test_function.cpp negative_function.cpp nnPSO.cpp dnnPSO.cpp \
	SOM2D.cpp KMeans.cpp HC.cpp GDALogic.cpp \
	tst/test.cpp tst/pso_main.cpp tst/somtest.cpp tst/gene_main.cpp \
	GeneticAlgorithm.cpp GeneticAlgorithm2.cpp test_function2.cpp \
	NNGradDescent.cpp NNRandomSearch.cpp HMC.cpp bayesian_nnetwork.cpp HMC_abstract.cpp HMC_gaussian.cpp \
	GA3.cpp ga3_test_function.cpp deep_ica_network_priming.cpp BFGS_nnetwork.cpp pBFGS_nnetwork.cpp \
	LBFGS_nnetwork.cpp pLBFGS_nnetwork.cpp sinh_nnetwork.cpp nnetwork_function.cpp ultradeep.cpp

OBJECTS= neuron.o neuronlayer.o \
	activation_function.o odd_sigmoid.o identity_activation.o multidimensional_gaussian.o \
	neuralnetwork.o backpropagation.o stretched_function.o optimized_function.o \
	optimized_nnetwork_function.o \
	PSO.o test_function.o negative_function.o nnPSO.o dnnPSO.o \
	SOM2D.o KMeans.o nnetwork.o HC.o GDALogic.o \
	GeneticAlgorithm.o GeneticAlgorithm2.o test_function2.o \
	NNGradDescent.o NNRandomSearch.o HMC.o bayesian_nnetwork.o HMC_abstract.o HMC_gaussian.o \
	GA3.o ga3_test_function.o deep_ica_network_priming.o BFGS_nnetwork.o pBFGS_nnetwork.o \
	LBFGS_nnetwork.o pLBFGS_nnetwork.o sinh_nnetwork.o nnetwork_function.o ultradeep.o

EXTRA_OBJECTS = ../math/vertex.o ../math/matrix.o ../math/ownexception.o ../math/integer.o \
	../math/matrix_rotations.o ../math/eig.o ../math/correlation.o ../math/blade_math.o \
	../math/real.o 	../dataset.o ../conffile.o ../MemoryCompressor.o ../linear_ETA.o \
	../dynamic_bitset.o ../math/ica.o ../math/BFGS.o ../math/LBFGS.o ../math/linear_algebra.o \
	../math/correlation.o ../math/ica.o ../math/linear_equations.o


TARGET1_OBJECTS= tst/test.o 
TARGET2_OBJECTS= tst/pso_main.o
TARGET3_OBJECTS= tst/somtest.o 
TARGET4_OBJECTS= tst/gene_main.o
TARGET1= testsuite1
TARGET2= testsuite2
TARGET3= testsuite3
TARGET4= testsuite4

OPTIMIZE=@optimization_flags@
CFLAGS=@CFLAGS@ -Wno-strict-aliasing -Wno-attributes -std=c++11 @EXTRA_INCLUDEPATHS@

CXXFLAGS=-Wall $(CFLAGS) @CXXFLAGS@ -g -I. -I.. -I../.. -I../math -I../crypto $(OPTIMIZE)

LIBS= @EXTRA_LIBPATHS@ -lgmp -lz -lpthread @EXTRA_LIBS@

##################################################

all: test1 test2 test3 test4

test1: $(TARGET1_OBJECTS) $(OBJECTS) $(EXTRA_OBJECTS)
	$(CXX) $(CXXFLAGS) -o $(TARGET1) $(TARGET1_OBJECTS) $(OBJECTS) $(EXTRA_OBJECTS) $(LIBS)

test2: $(TARGET2_OBJECTS) $(OBJECTS) $(EXTRA_OBJECTS)
	$(CXX) $(CXXFLAGS) -o $(TARGET2) $(TARGET2_OBJECTS) $(OBJECTS) $(EXTRA_OBJECTS) $(LIBS)

test3: $(TARGET3_OBJECTS) $(OBJECTS) $(EXTRA_OBJECTS)
	$(CXX) $(CXXFLAGS) -o $(TARGET3) $(TARGET3_OBJECTS) $(OBJECTS) $(EXTRA_OBJECTS) $(LIBS)

test4: $(TARGET4_OBJECTS) $(OBJECTS) $(EXTRA_OBJECTS)
	$(CXX) $(CXXFLAGS) -o $(TARGET4) $(TARGET4_OBJECTS) $(OBJECTS) $(EXTRA_OBJECTS) $(LIBS)

clean:
	$(RM) $(OBJECTS)
	$(RM) $(TARGET1_OBJECTS) $(TARGET2_OBJECTS) $(TARGET3_OBJECTS) $(TARGET4_OBJECTS)
	$(RM) $(TARGET1) $(TARGET2) $(TARGET3) $(TARGET4)
	$(RM) *~

realclean: clean
	$(RM) *.o *.rpo
	$(RM) tst/*.o tst/*.rpo

depend:
	$(CXX) $(CXXFLAGS) -MM $(SOURCES) > Makefile.depend

##################################################
# must have initially empty dependencies file

include Makefile.depend




